package javabook.ch06;


class Sungjuk_6_2 { 
	String hakbun; 
	String name; 
	int jumsu; 
	public void set_hakbun(String hakbun) { 
		this.hakbun = hakbun;
		} 
	public void set_name(String name) { 
		this.name = name; } 
	public void set_jumsu(int jumsu) { 
		this.jumsu = jumsu; } 
	void prt_data() { 
		System.out.println(hakbun + "  " + name + " " + jumsu);} 
	void title() { 
		System.out.println("*** 상속(inheritance) / 오버라이딩 (overriding) 사용 ***"); 
		System.out.println("*** 자바의 성적 출력 ***"); 
		System.out.println("**학번** **성명** **점수**"); 
		System.out.println("---------------------------"); 
		} 
	}
class Sungjuk_6_2_1 extends Sungjuk_6_2 { 
	String grade; 

	
	 public void set_grade(String grade) { 
		 this.grade = grade; } 
		 void prt_data() { 
		 System.out.println(hakbun + "  " + name + " " + grade); 
		 }
		 void title() { 
		 super.title(); }}
	class Jv_6_2 extends Sungjuk_6_2 { 
		public static void main(String[] args) { 
			Sungjuk_6_2 ken_sung = new Sungjuk_6_2();
			ken_sung.set_hakbun("2060001"); 
			ken_sung.set_name("Ko Eung-Nam"); 
			ken_sung.set_jumsu(60); 
			Sungjuk_6_2 wife_sung = new Sungjuk_6_2(); 
			wife_sung.set_hakbun("2060002"); 
			wife_sung.set_name("Boo Chang-Mi"); 
			wife_sung.set_jumsu(80); 
			Sungjuk_6_2 yoo_sung = new Sungjuk_6_2(); 
			yoo_sung.set_hakbun("2060003"); 
			yoo_sung.set_name("Ko Yoo-Jin"); 
			yoo_sung.set_jumsu(100); 
			
			Sungjuk_6_2 soo_sung = new Sungjuk_6_2(); 
			soo_sung.set_hakbun("2060004"); 
			soo_sung.set_name("Ko Su-Ji"); 
			soo_sung.set_jumsu(99); 
			Sungjuk_6_2 ttt = new Sungjuk_6_2(); 
			ttt.title(); 
			ken_sung.prt_data(); 
			wife_sung.prt_data(); 
			yoo_sung.prt_data(); 
			soo_sung.prt_data(); 
			Sungjuk_6_2_1 sub_ken_sung = new Sungjuk_6_2_1();
			sub_ken_sung.hakbun = ken_sung.hakbun; 
			sub_ken_sung.name = ken_sung.name; 
			sub_ken_sung.set_grade("D"); 
			Sungjuk_6_2_1 sub_wife_sung = new Sungjuk_6_2_1(); 
			sub_wife_sung.hakbun = wife_sung.hakbun; 
			sub_wife_sung.name = wife_sung.name; 
			sub_wife_sung.set_grade("B"); 
			Sungjuk_6_2_1 sub_yoo_sung = new Sungjuk_6_2_1(); 
			sub_yoo_sung.hakbun = yoo_sung.hakbun;
			
			sub_yoo_sung.name = yoo_sung.name; 
			sub_yoo_sung.set_grade("A"); 
			Sungjuk_6_2_1 sub_soo_sung = new Sungjuk_6_2_1(); 
			sub_soo_sung.hakbun = soo_sung.hakbun ; 
			sub_soo_sung.name = soo_sung.name; 
			sub_soo_sung.set_grade("A"); 
			Sungjuk_6_2_1 kkk = new Sungjuk_6_2_1(); 
			kkk.title(); 
			sub_ken_sung.prt_data(); 
			sub_wife_sung.prt_data(); 
			sub_yoo_sung.prt_data(); 
			sub_soo_sung.prt_data(); 
			Sungjuk_6_2 mix_ken_sung = new Sungjuk_6_2_1();
			mix_ken_sung.hakbun = ken_sung.hakbun; 
			mix_ken_sung.name = ken_sung.name; 
			//mix_ken_sung.set_grade("D"); <--- error 
			Sungjuk_6_2 mix_wife_sung = new Sungjuk_6_2_1(); 
			mix_wife_sung.hakbun = wife_sung.hakbun; 
			mix_wife_sung.name = wife_sung.name; 
			//mix_wife_sung.set_grade("B"); <--- error 
			Sungjuk_6_2 mix_yoo_sung = new Sungjuk_6_2_1(); 
			mix_yoo_sung.hakbun = yoo_sung.hakbun; 
			mix_yoo_sung.name = yoo_sung.name; 
			//mix_yoo_sung.set_grade("A"); <--- error 
			Sungjuk_6_2 mix_soo_sung = new Sungjuk_6_2_1(); 
			mix_soo_sung.hakbun = soo_sung.hakbun ; 
			mix_soo_sung.name = soo_sung.name; 
			//mix_soo_sung.set_grade("A"); <--- error       
			Sungjuk_6_2 mmm = new Sungjuk_6_2_1(); 
			mmm.title(); 
			mix_ken_sung.prt_data(); 
			mix_wife_sung.prt_data(); 
			mix_yoo_sung.prt_data(); 
			mix_soo_sung.prt_data();
			}
		}
		
